<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<link rel="Shortcut Icon" href="<s:url value="/favorite.ico" />" />
<title>登录-${projectConfig.name}</title>
<jsp:include page="/components/clientResource.jsp"></jsp:include>
<style type="text/css">
html,body {
	height: 100%;
	width: 100%;
}

#logo {
	width: 253px;
	margin: 0 auto;
	padding: 5em;
}

#login {
	width: 500px;
	margin: 0 auto;
	padding: 3em;
	background: #fff;
	border: 1px solid #ddd;
}

form.inlineform div.padding {
	padding: 0.5em 0;
}

#footer {
	text-align: center;
	margin: 5em auto;
}

#board {
	width: 960px;
	margin: 0 auto;
}
</style>
<script type="text/javascript">
	$(function() {
		$("#theme").change(function() {
			var theme = this.value;
			location = "login.do?theme=" + theme;
		});

		var username = $.cookie("username");
		if (username) {
			$("#name").val(username);
		}
		var password = $.cookie("password");
		if (password) {
			$("#password").val(password);
			$("#remb").attr("checked", true);
		}
		$("#password").focus(function() {
			this.select();
		});

		$(document).keypress(function(e) {
			if (e.which == 13) {
				$("form").submit();
			}
		});

		// HTML编辑器创建后，配置输入验证
		$("form").Validform({
			btnSubmit : ".btn",
			showAllError : true,
			ajaxPost : true,
			datatype : ValidUtils.types("name", "pwd"),
			beforeCheck : function(form) {
				var name = $("#name").val();
				var expires = new Date();
				expires.setDate(expires.getDate() + 360);
				$.cookie("username", name, {
					expires : expires
				});
			},
			beforeSubmit : function(form) {
				if ($("#remb").attr("checked")) {
					var password = $("#password").val();
					var expires = new Date();
					expires.setDate(expires.getDate() + 30);
					$.cookie("password", password, {
						expires : expires
					});
				} else {
					$.cookie("password", "");
				}
			},
			callback : function(data) {
				helper.showMsg(data, {
					successHandler : function() {
						location = "../../welcome/changeCampus.do?first=1&campus=" + data.user.campus.id;
					}
				})
			},
			tiptype : ValidUtils.noSuccessTip
		});
	});
</script>
</head>
<body style="max-width: 100%">
	<div id="board">
		<div id="logo">
			<!-- 
			<img src="<s:url value="/client-resources/images/logo.png" /> " />
			 -->
		</div>
		<div id="login">
			<p class="blue">请在此输入用户名、密码完成登录</p>
			<form class="form-horizontal" action="../auth/doLogin" method="post">
				<div class="control-group">
					<label class="control-label" for="name">用户名</label>
					<div class="controls">
						<input type="text" class="text3" name="loginName" id="name" datatype="name" nullmsg="请输入用户名" errormsg="用户名只能是1-20个字符" /> <span class="Validform_checktip"></span>
					</div>
				</div>
				<div class="control-group ">
					<label class="control-label" for="password">密码</label>
					<div class="controls">
						<input class="text3" type="password" name="password" id="password" datatype="pwd" nullmsg="请输入密码" errormsg="密码只能是6-16个字符" /> <span class="Validform_checktip"></span>
					</div>
				</div>
				<div class="control-group ">
					<label class="control-label" for="theme">主题</label>
					<div class="controls">
						<s:select list="#{'tiles':'蓝白致简'}" cssClass="text2" name="theme" id="theme" value="#ui_theme"></s:select>
					</div>
				</div>
				<div class="control-group ">
					<label class="control-label" for="remb">记住密码</label>
					<div class="controls">
						<input type="checkbox" id="remb" /> <span class="remark" style="display: inline;">在公共环境下建议不要勾选该选项</span>
					</div>
				</div>
				<div class="control-group">
					<div class="controls">
						<a href="javascript:void(0)" class="btn btn-primary">登录</a>
					</div>
				</div>
			</form>
			<pre>
2013-7-21更新日志：
导入的excel不再需要拆分日期单元格
增加了“查看其他校区”的权限，只有有权限的人才能看其他校区
优化了导入课表的速度
修正了批量删除课表个数过多，没有响应的问题
修正了打印时无法打印背景色的问题
			</pre>
		</div>
		<div id="footer" class="footer">
			<span>教学支持系统 &copy;扬州环球雅思</span>
		</div>
	</div>
</body>
</html>